import { request } from "@/utils/request";
import axios from "axios";
export function getAccessToken(){
    return request({
        method: 'get',
        url: '/ERNIEBot',
        headers: {
            'token': window.localStorage.token,
        },
    })
}

export function ERNIEBotRequest(params,token){
    return axios({
        method:'post',
        url: 'https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions?access_token='+token,
        data: params,
        headers: {
            'Content-Type': "application/json"
        }
    })(

    )
}